1. Field of the Invention
A method for determining synchronization code under the Standard Mobile Image Architecture (SMIA), in particular, for using iterative comparison operations to obtain the correct position of the synchronization code, so as to correctly translate the received image data.
2. Description of Related Art
Because of the rapid market growth of mobile phones or other portable devices with camera function, the Standard Mobile Image Architecture (SMIA) provides a standard for transferring image data over mobile devices, wherein the SMIA is an image process architecture specifically applicable on mobile devices, which offers better performance between SMIA-compliant sensor and connected SMIA-compliant host, and specifies elements including housing, mechanical interconnection, functionality, register set and interface.
When transferring images among mobile devices, according the aforementioned SMIA that defines eleven types of image data format, in which synchronization code includes bit codes for the start of a frame, such as SOF (frame start synchronization code); the end of a frame, such as EOF (frame end synchronization code); start bit of the line in an image pixel array, such as SOL (line start synchronization code); and end bit of the line, such as EOL (line end synchronization code). When transmitting, the transmissions of data as well as synchronization code both start from the lowest significant bit (LSB). Refer to Table 1 for each synchronization code, in which SOL, EOL, SOF, EOF and logical channel are specified.
TABLE 1Synchronization CodeValueLine Start Code (SOL)FFH00H00HX0H(X: number of channels)Line End Code (EOL)FFH00H00HX1HFrame Start Code (SOF)FFH00H00HX2HFrame End Code (EOF)FFH00H00HX3HLogical ChannelFFH00H00H0XH to FFH00H00H7XH
FIG. 1 shows a frame diagram of the SMIA, which takes a VGA image file as an example, the data shown in the diagram (for VGA format, 480 lines from line 1 to line 480) is the image file data defined between frame end code (EOF) and frame start code (SOF), and a frame blanking period is defined outside the frame; meanwhile, a line blanking is also defined between line end code (EOL) and line start code (SOL).
The arrangement of data in the memory is illustrated in FIG. 2, wherein the transmission of each byte starts from the maximum significant bit (MSB), and the least significant bit (LSB) is the last one transferred. The arrangement in the memory is shown as bits 31-24, 23-16, 15-8 and 7-0; but when transferring image data under SMIA, bit stream thereof is output from the camera module in the mobile device; and before transferring any data, the least significant bit (LSB) will be transferred first, as the bit flow shown in the figure, reversing the positions of MSB and LSB, thus starting from LSB, e.g. 24-31, 16-23, 8-15 and 0-7.
As shown in FIG. 3, in the data received by a receiver, each frame starts from a frame start code (SOF), and ends at a frame end code (EOF), in which each line therein starts from a line start code (SOL) and ends at a line end code (EOL), forming a bit stream configuration illustrated in FIG. 1, wherein the first line start code is replaced by a frame start code, and the last line end code is substituted by a frame end code. The above-mentioned logical channels separate the interlaced data into different data flows, in which there are 0 to 7 channels in quantity.